#include <iostream>
#include <string>
using namespace std;

class Beverage{
	public:
		Beverage(){
			description = "Unknown Beverage";
		}
		virtual string getDescription(){
			return description;
		}
		virtual double cost ()  = 0;
		string description;
};

class CondimentDecorator:public Beverage{
	public:
		virtual string getDescription() = 0;
};

class Espresso:public Beverage{
	public:
		Espresso(){ description = "Espresso";}
		double cost(){return 1.99;}
};

class HouseBlend:public Beverage{
	public:
		HouseBlend(){description = "HouseBlend";}
		double cost(){return 0.99;}
};


class Mocha:public CondimentDecorator{
	public:
		Beverage *beverage;
		Mocha(Beverage *beverage){
			this->beverage = beverage;
		}
		string getDescription(){
			return beverage->getDescription() + ",Mocha";
		}

		double cost(){
			return 0.20 + beverage->cost();
		}		
};

class Soy:public CondimentDecorator{
	public:
		Beverage *beverage;
		Soy(Beverage *beverage){
			this->beverage = beverage;
		}
		string getDescription(){
			return beverage->getDescription() + ",Soy";
		}

		double cost(){
			return 0.28 + beverage->cost();
		}		
};

class Whip:public CondimentDecorator{
	public:
		Beverage *beverage;
		Whip(Beverage *beverage){
			this->beverage = beverage;
		}
		string getDescription(){
			return beverage->getDescription() + ",Whip";
		}

		double cost(){
			return 0.28 + beverage->cost();
		}		
};
int main(){
//	Beverage  *beverage = new Espresso();
//	cout << beverage->getDescription() <<", $" << beverage->cost();

	Beverage *beverage2 = new HouseBlend();
	beverage2  = new Mocha(beverage2);
	beverage2  = new Soy(beverage2);
	beverage2  = new Whip(beverage2);
	cout << beverage2->getDescription() <<", $" << beverage2->cost();
	return 0;
}



